local qufu = fk.CreateSkill{
    name = "lingling__qufu"
}
Fk:loadTranslationTable{
    ["lingling__qufu"] = "趋附",
    [":lingling__qufu"] = "当其他角色使用【杀】对你造成伤害后，你可以将手牌摸至与其相同。",
    ["#lingling__qufu"] = "是否发动 趋附，将手牌摸至与 %dest 相同（%arg张）",
}
local U = require "packages/utility/utility"

qufu:addEffect(fk.Damaged, {
    anim_type = "masochism",
    can_trigger = function (self, event, target, player, data)
        return target == player and player:hasSkill(qufu.name) and data.card.trueName == "slash" and data.from and data.from ~= player and data.from:getHandcardNum() > player:getHandcardNum()
    end,
    on_cost = function (self, event, target, player, data)
        if player.room:askToSkillInvoke(player, {
            skill_name = qufu.name,
            prompt = "#lingling__qufu::"..data.from.id..":"..U.ConvertNumber(data.from:getHandcardNum())
        }) then
            return true
        end
    end,
    on_use = function (self, event, target, player, data)
        player:drawCards(data.from:getHandcardNum() - player:getHandcardNum(), qufu.name)
    end,
})

return qufu